package com.ygsoft.activiti.model;

import org.activiti.engine.history.HistoricProcessInstance;

import java.util.Date;

/**
 * 用户Dao
 *
 * @author zhx
 * @create 2017-11-08 14:21
 **/
public class MyActivity {
    private String processId;
    private String businessKey;
    private String businessId;
    private Date startTime;
    private Date endTime;
    private String userId;
    private String userName;
    private String businessStatus;

    public MyActivity(HistoricProcessInstance h) {
        this.processId = h.getId();
        this.businessKey = h.getProcessDefinitionKey();
        this.businessId = h.getBusinessKey();
        this.startTime = h.getStartTime();
        this.endTime = h.getEndTime();
        this.userId = h.getStartUserId();

        if(h.getEndTime() != null){
            this.businessStatus = "流转中";
        }else{
            this.businessStatus = "已结束";
        }
    }

    public String getProcessId() {
        return processId;
    }

    public void setProcessId(String processId) {
        this.processId = processId;
    }

    public String getBusinessKey() {
        return businessKey;
    }

    public void setBusinessKey(String businessKey) {
        this.businessKey = businessKey;
    }

    public String getBusinessId() {
        return businessId;
    }

    public void setBusinessId(String businessId) {
        this.businessId = businessId;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getBusinessStatus() {
        return businessStatus;
    }

    public void setBusinessStatus(String businessStatus) {
        this.businessStatus = businessStatus;
    }
}
